package com.hong;

public class DaemonDemo {

    public static class DaemonT implements Runnable{

        @Override
        public void run() {
            while (true){
                System.out.println("I am alive");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }

        public static void main(String[] args) throws InterruptedException {
            Thread thread = new Thread(new DaemonT());
            thread.setDaemon(true);
            thread.start();


            Thread.sleep(6000);

        }

    }


}
